package com.example.TodayNews;


import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;

import android.support.v4.app.FragmentTransaction;
import android.view.Window;
import android.widget.RadioGroup;
import com.example.TodayNews.fragments.NewsFragment;


public class MainActivity extends FragmentActivity {

    private RadioGroup radioGroup;
    /**
     * Called when the activity is first created.
     */

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);
        radioGroup = (RadioGroup) findViewById(R.id.tab_radio_group);
        FragmentManager fragmentManager = getSupportFragmentManager();
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        //加载新闻页Fragment
        NewsFragment newsFragment = new NewsFragment();
        fragmentTransaction.replace(R.id.fragment_container,newsFragment,"newsFragment");
        fragmentTransaction.commit();


    }

}
